/*
This is the place to write the top-level stuff to be done in scripted mode
*/

void runScripts() {
//  runBeringTuningEnsemble("C glacialis","particles/forcing_ieb_2009_mean.nc", 47, 195, "output/ieb_tuning_0716/ieb_tuning", "work/06 earlier, southerlier/bering parameters.xls", 20000);

//  runIEB("");

//  int[] years = new int[2012-1978+1]; for (int i=0; i<years.length; i++) years[i] = 1978+i;
//  int[] years = new int[11]; for (int i=0; i<years.length; i++) years[i] = 2040+i;
  int[] years = {1981, 2003, 2012, 2040, 2043, 2050};
  for (int i=0; i<years.length; i++) {
    runBeringEnsemble("C glacialis","forcing/shelf/forcing_shelf_" + years[i] + ".nc", 47, 195, "output/shelf_Q1b0/shelf_" + years[i] + "/shelf", 10, "work/09 copepod traits/bering parameters Q1b0.xls");
  }

//  int[] years = {2000, 2002, 2004, 2006, 2008, 2010, 2012, 2040, 2042, 2044, 2046, 2048, 2050};
//  int[] years = {2000, 2004, 2008, 2012, 2040, 2044, 2048};
//  for (int i=0; i<years.length; i++) {
//    runBeringEnsemble("C glacialis","forcing/M5/forcing_M5_" + years[i] + "_mean.nc", 47, 195, "output/M5/M5_"+years[i], 1, "work/08 many years/bering parameters.xls");
//    runBeringEnsemble("C glacialis","forcing/M5/forcing_M5_" + years[i] + "_mean.nc", 47, 195, "output/M5_mod/M5_"+years[i], 1, "work/08 many years/bering parameters mod.xls");
// }  
} 
 
 
 
void runIEB(String suffix) {
  String species = "C glacialis";
  String run = "ieb_2009" + suffix;
  String forcing = "ieb_2009";
  int stride = 20;
  runBeringEnsemble(species,"particles/forcing_"+forcing+".nc", 47, 195, "output/"+run+"/"+run, stride, "work/06 earlier, southerlier/bering parameters" + suffix + ".xls");
}

void runOneYear(int year) {
  String species = "C glacialis";
  String run = "nmo_"+year;
  String forcing = "nmo_"+year;
  int stride = 10;
  runBeringEnsemble(species,"particles/forcing_"+forcing+".nc", 47, 195, "output/"+run+"/"+run, stride, "bering parameters.xls");
}

void runFourNMOParamCombos() {
  String species = "C glacialis";
  int[] years = {2009, 2044};
  for (int j=0; j<years.length; j++) {
    int year = years[j];
    for (int i=1; i<=4; i++) {
      String forcing = "nmo_"+year;
      String run = "nmo_"+year+"combo"+i;
      int stride = 30;
      runBeringEnsemble(species,"particles/forcing_"+forcing+".nc", 92, 195, "output/tuningCombos/"+run, stride, "bering parameters_combo"+i+".xls");
    }
  }
}



/*
This is the place to assemble the top-level choices available in the GUI.
A "project" is a list of model cases. Use pl.addProject() to add another entry to the projects toolbar at the very top of the window.
A "model" in this context is an Environment object with a linked Ecosystem object. Use addModel() to add an entry to the second toolbar.
A "view" is a display mode for a particular model. These will show up in a toolbar at the bottom if a model has more than one of them. Use "addView".
Note also the makeDefault() methods.

Right now, the sequence that these things show up in the toolbars can't be controlled. This is a limitation of the HashMap implementation, which ought
to change in the future.

Note that all the configuration done here is run _before_ the projects, models, and views get linked to the GUI, and thus at this point they don't
have access to the screen layout, colors, fonts, etc. Any graphical customization of a View has to be done within the View.define() method.
*/


ProjectList assembleMasterProjectList() {
  String basePath = "/Users/neil/Dropbox/bering/";
  String paramFile = basePath + "work/06 earlier, southerlier/bering parameters.xls";
  ForcingSet forcing = new ForcingSet(basePath + "particles/forcing_ieb_2009_mean.nc");
  Environment env = new BeringWaterCol(20, 130, 5, paramFile, "C glacialis", 98, 195, forcing, 0);
 
  
  NetworkView nv;
  PColorNetworkSwitcherView switcher;
  nv = new BeringNetworkView((BeringEcosystem)env.eco);
  nv.currentCell = ((Slice)env).K-1;
  switcher = new PColorNetworkSwitcherView((Slice)env, nv);
  switcher.addVar("PAR", 0, 150);
  switcher.addVar("temp", -2, 6);
  switcher.addVar("NO3", 0, 30);
  switcher.addVar("NH4", 0, 10);
  switcher.addVar("SP", 0, 10);
  switcher.addVar("LP", 0, 10);
  switcher.addVar("MZ", 0, 2);
  switcher.addVar("CA",0,2);
  env.addView(switcher);
  
  Project p = new Project("Bering");
  p.addModel(env);
  ProjectList pl = new ProjectList();
  pl.addProject(p);
  return pl;
}

